package cn.xbtop.blog.service.impl;

import cn.xbtop.blog.mapper.AdminMapper;
import cn.xbtop.blog.pojo.Admin;
import cn.xbtop.blog.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
/**
 * @author  Mxb
 * @date  2020/2/19 15:44
 * @version 1.0
 */
@Service
public class AdminServiceImpl implements AdminService{

    @Resource
    private AdminMapper adminMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return adminMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Admin admin) {
        return adminMapper.insert(admin);
    }

    @Override
    public Admin selectByPrimaryKey(Integer id) {
        return adminMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKey(Admin admin) {
        return adminMapper.updateByPrimaryKey(admin);
    }

    @Override
    public Admin selectByUsername(String username) {
        return adminMapper.selectByUsername(username);
    }

    /**
     * 获取管理员信息
     * @return
     */
    @Override
    public Admin getAdmin() {
        return adminMapper.getAdmin();
    }

    /**
     * 修改密码
     */
    @Override
    public void updatePassword() {


    }
}
